<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Confirmar</title>

<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/tablas.css" rel="stylesheet">
<script src="../js/jquery-1.9.0.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
<style type="text/css">
<!--

body {
        padding-top: 40px;
        padding-bottom: 40px;
        background-color: #ccff33;
      }

      .form-signin {
        max-width: 300px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
        margin-bottom: 15px;
        padding: 7px 9px;
      }
-->
    </style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
            		<span class="icon-bar"></span>
            		<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
		  </div>
				<b><a class="brand" href="../index.html">ABRASISA</a></b>
          			<div class="nav-collapse collapse">
					
            			
						<ul class="nav">
              				<li class="active"><a href="productos.php">Regresar</a></li>
            			</ul>
						
				 </div>
										
   </div>
</div><!--/.nav-collapse --> 
<hr></hr>
<h4>
</center>
<div class="container">
<?php
include ("configuracion.php");
$iva=0.16;
?>
<form id="envio" name="formulario" action="guardado.php" method="post">
	   Confirmar Presupuesto
	   <div style="text-align: right;">Fecha <? echo $hoy = date("Y-m-j"); ?></div>
	    <hr />
	   <table class="table table-striped">
       <tr><th></th>
	   <th>Razon Social</th>
	   <th>Direccion</th>
	   <th>Telefono</th>
	   <th>R.F.C</th>	 
       <th>E-mail</th></tr>
 <?php $rfc1=$_POST['cliente'];
   $query2=mysql_query("select * from clientes where rfc='".$rfc1."'");
   while ($row2 = mysql_fetch_array($query2)){?>
	   <tr>
	       <td><font face=\"verdana\"><input type="hidden" value="<?php echo $id=$row2['idCli']?>" name="id"><?php echo $id=$row2['idCli']?></font></td>
	       <td><font face=\"verdana\"><?php echo $row2['nombre']?></font></td>
		   <td><font face=\"verdana\"><?php echo $row2['direccion']?></font></td>
		   <td><font face=\"verdana\"><?php echo $row2['telefono']?></font></td>
		   <td><font face=\"verdana\"><?php echo $row2['rfc']?></font></td>
		   <td><font face=\"verdana\"><?php echo $row2['email']?></font></td> 
		</tr><?php }?>
</table>  
 <table class="table table-striped">
       <tr>
	   <th>Codigo</th>
	   <th>Descripcion</th>
	   <th>Cantidad</th>
	   <th>Precio Venta</th>	   
	   </tr>	  
<?php
if(isset($_POST["chk"]))
{
$can=$_POST["chk"];
    foreach($can as $i => $codigo){

        $v=$_POST["cantidad_".$codigo];        
		$query= mysql_query("select * from productos where codigo= '$codigo'");
   while ($row = mysql_fetch_array($query)){?>
<tr>
   
<td><font face=\"verdana\"><input type="hidden" value="<?php echo $row['codigo']?>" name="cod[]"><?php echo $row['codigo']?></font></td>
<td><font face=\"verdana\"><input type="hidden" value="<?php echo $desc=$row['nombrePro']?>" name="pro[]"><?php echo $desc=$row['nombrePro']?></font></td>
<td><font face=\"verdana\"><input type="hidden" value="<?php echo $v?>" name="can[]"><?php echo $v?></font></td>
<td><font face=\"verdana\"><input type="hidden" value="<?php echo $preciov = $v * $row['Precio']?>" name="pre[]"><?php echo $preciov = $v * $row['Precio']?></font></td>		   
  </tr>
	   <font face=\"verdana\"><?php  $Stotal=$Stotal+$preciov; }}}?>
	   <tr>
		 <th></th><th></th><th>SubTotal</th><th><?echo $Stotal?></th>
	   </tr>
	   <tr>
		 <th></th><th></th><th>IVA</th><th><?echo $Tiva=$Stotal * $iva;?></th>
   </tr>
  <tr>
	 <th></th><th></th><th>Total</th><th><input type="hidden" value="<?echo $total=$Stotal + $Tiva;?>" name="tot"><?echo $total=$Stotal + $Tiva;?></th>
  </tr>
 </table>  

   <hr />
     <button class="btn btn-large btn-primary" type="submit">Confirmar</button>
	  <button class="btn btn-large btn-primary" type="button" onclick="location.href = 'productos.php'" >Cancelar</button>
 </form>	 
</div>
	 </center>	
	 </h4>
</body>
</html>